﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jumpton.SFA.Server.Entity;
using Jumpton.Persistent;

namespace Jumpton.SFA.Server.BusinessRule.MasterData
{
    public class ContactManager:BusinessLogic
    {
        //public ObjectTable GetCourseTable()
        //{
        //    return new ObjectTable(typeof(CONTACT_INFO));
        //}
        public ObjectTable GetCourseTable(decimal domainID)
        {
            return new ObjectTable(typeof(CONTACT_INFO), "this.DOMAINID='" + domainID + "'");
        }
        public CONTACT_INFO Load(decimal customerID)
        {
            return (CONTACT_INFO)ObjectRow.Load(typeof(CONTACT_INFO), string.Format("this.CUSTOMERID={0}", customerID));
        }


        public bool Save(CONTACT_INFO contact)
        {
            bool Successful = false;
            if (contact != null)
            {
                try
                {
                    contact.Save();
                    Successful = true;
                }
                catch (Exception err)
                {
                    message = err.Message;throw err;
                   
                }
            }

            return Successful;
        }

        public bool Delete(CONTACT_INFO contact)
        {
            bool Successful = false;
            if (contact != null)
            {
                try
                {
                    contact.Delete();
                    Successful = true;
                }
                catch (Exception err)
                {
                    message = err.Message;throw err;
                  
                }
            }

            return Successful;
        }
    }
}
